<template>
	<view style="display: flex;flex-direction: column;background-color: #FFFFFF;">
		<view style="border-bottom:1px solid #e7e8e8;width: 100%;"></view>
		
		<view class="" v-for="(item) in 5">

		
		<view class="u-m-l-30 u-m-r-30" style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;border-bottom:1px solid #e7e8e8;padding-bottom: 30rpx;width: 95%;;margin-top: 30rpx;" v-for="(item,index) in mesList" :key="index" @tap="goDetail(item)">
			<view style="display: flex;flex-direction: column;">
				<view style="font-weight: bold;">{{item.title}}</view>
				<view class="u-font-12" style="color: #999999;margin-top: 15rpx;width: 400rpx;">{{item.content}}</view>
			</view>
			<view class="u-font-12" style="color: #999999;margin-right: 20rpx;">{{item.addtime}}</view>
		</view>
		
		</view>
			
		<view v-if="mesList.length===0" style="padding:350rpx 0rpx;background-color: rgb(246,247,248);">
			<u-empty  text="暂无系统消息" mode="message"></u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mesList:[],
				page:1
			}
		},
		onShow() {
			this.swiperShow()
		},
		onLoad(options) {
			if(res.data.length!==0)
				this.mesList.push(res.data);
		},onReachBottom() {
			this.swiperShow()
		},
		computed: {

		},
		methods: {
			swiperShow(){
				this.$request("kehu/other/sysMessage",{type:2,pageNum:this.page}).then(res=>{
					let tempLists = res.data.length===0?[]:res.data;
					if(this.page== 1){
						this.mesList = [];
					}
					this.mesList= this.mesList.concat(tempLists);
					
					if(tempLists.length<20){
						this.status = "nomore";
					}
					this.page = this.page +1;
				});
				
			},
			goDetail(item){
				 //console.log(item);
				var title = item.title;
				var time = item.addtime;
				var content = item.content;
				uni.navigateTo({
					url:`./xiaoxi_detail?title=${title}&time=${time}&content=${content}`
				})
			}
		}
	}
</script>

<style>
	
</style>
